<?php
declare(strict_types = 1);

namespace leruge\command;

use think\console\Command;

class Register extends Command
{
    public function configure()
    {
        $this->setName('register')
            ->setDescription('win下register启动');
    }

    public function handle()
    {
        $this->output->info('register启动');
        $registerAddress = config('chat.register_address') ?: '127.0.0.1:1201';
        $register = new \GatewayWorker\Register('text://' . $registerAddress);
        $register->name = config('chat.register_name') ?: 'register';
        \Workerman\Worker::runAll();
    }
}
